#
# @lc app=leetcode.cn id=461 lang=python
#
# [461] 汉明距离
#

# @lc code=start
class Solution(object):
    def hammingDistance(self, x, y):
        """
        :type x: int
        :type y: int
        :rtype: int
        """
        # return bin(x^y).count('1')
        if x == y:
            return 0
        result = 0
        while x!= 0 or y!= 0:
            if x % 2!= y % 2:
                result+=1
            x = x >> 1
            y = y >> 1
        return result
# @lc code=end

